<%@ page import="com.news.db.OpDB" %>
<%@ page import="com.news.model.Type" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.news.tools.DoString" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>前台顶部文件</title>
  </head>
  <body>
    <form action="${pageContext.request.contextPath}/searchServlet" method="post">
      <table border="0" width="900" height="90" background="images/logo.jpg">
        <tr>
          <td></td>
        </tr>
      </table>
      <table border="1" width="900" height="32" cellpadding="0" cellspacing="0" rules="rows">
        <tr>
          <td align="center"><a href="view/IndexTemp.jsp">首页</a></td>
          <!--输出数据库中新闻类别-->
          <%
            OpDB opdb = new OpDB();
            ArrayList<Type> list = opdb.OpGetType();
            if (list != null && list.size() > 0){
              for (int i = 0; i < list.size(); i++) {
          %>
          <td align="center"><a href="view/IndexTemp.jsp?info_type=<%=list.get(i).getId()%>&mainPage=newsinfo"><%=list.get(i).getType_name()%></a></td>
          <%
              }
            }
          %>
          <!--输出当前时间-->
          <td align="center"><%=DoString.formatDate()%></td>
          <td align="right"><input type="text" name="search"></td>
          <td align="center"><input type="submit" value="搜索"></td>
        </tr>
      </table>
    </form>
  </body>
</html>